{literal}
<script type="text/javascript">
function category_button(id){
	$('#left_details_buttons_kategorie').css('display','none');
	$('.left_details').css('display','block'); 
	
	$('#animated-baner-homepage').cycle('pause'); 
	$('#animated-baner-homepage').css('display','none'); 
	
	$('#'+id).cycle('resume');
	$('#'+id).css('display','block');
}

</script>
{/literal}
<div id="left_details_buttons_kategorie" >
	<div class="left_details_button" id="{$kat0[0].tacID}" title="Find {$kat0[0].tacNazwa}" onclick="category_button('animated-baner-takeaway');">
		<h3 id="nazwa_kategori_1"><strong id="kategoria-01">{$kat0[0].tacNazwa}</strong><br />
		<span>see where You can eat</span></h3>
		<img src="{$smarty.const.HTTP_URL|cssfiles:$smarty.server.HTTP_HOST:$settings.szablon:$settings.ramka_theme:$settings.ramka_theme_kolor:"main_left_gr1.gif"}" alt="" border="0" width="336" height="128"/> 
	</div>
	
	<div class="left_details_button" id="{$kat0[1].tacID}" title="Find {$kat0[1].tacNazwa}" onclick="category_button('animated-baner-restaurant');">
		<h3 id="nazwa_kategori_2"><strong id="kategoria-02">{$kat0[1].tacNazwa}</strong><br />
		<span>see where You can eat</span></h3>
		<img src="{$smarty.const.HTTP_URL|cssfiles:$smarty.server.HTTP_HOST:$settings.szablon:$settings.ramka_theme:$settings.ramka_theme_kolor:"main_left_gr2.gif"}" alt="" border="0" width="336" height="128"/> 
	</div>
  
	<div class="left_details_button" id="{$kat0[2].tacID}" title="Find {$kat0[2].tacNazwa}" onclick="category_button('animated-baner-pubgrub');">
		<h3 id="nazwa_kategori_3"><strong id="kategoria-03">{$kat0[2].tacNazwa}</strong><br />
		<span>see where You can eat</span></h3>       
		<img src="{$smarty.const.HTTP_URL|cssfiles:$smarty.server.HTTP_HOST:$settings.szablon:$settings.ramka_theme:$settings.ramka_theme_kolor:"main_left_gr3.gif"}" alt="" border="0" width="336" height="128"/> 
	</div>
</div>

<div class="left_details"  style="display: none;">
	<div class="wyszukiwanie-ofert-form">
	<h2 id="nazwa-wyszukiwarki">Find </h2>
	
	<form id="wyszukaj-oferty" action="{$smarty.const.HTTP_URL}{$settings_katalog_ta.mainpage|default:$page},,show_category,0.html" method="post">
	<div>
		<div class="skinnedSelect">
			<select name="tacID1" id="tacID1">
				<option value="" selected="selected">County</option>
			{section name=id loop=$kat0}
				<option value="{$kat0[id].tacID}">{$kat0[id].tacNazwa}</option>
			{/section}
			</select>
		</div>
	</div>
	<div>
		<div class="skinnedSelect">
			<select name="tacID2" id="tacID2">
				<option value="" selected="selected">Town</option>
			</select>
		</div>
	</div>
	<div>
		<div class="skinnedSelect">
			<select name="tacID3" id="tacID3">
				<option value="" selected="selected">Locality</option>
			</select>
		</div>
	</div>
	<br/><br/>
	<div>
		<div class="skinnedSelect">
			<select name="tacID4" id="tacID4">
				<option value="" selected="selected">Cuisine Types</option>
				{dispatcher->handleEvent v=KatalogTA,wyswietlListeSlownikaKuchniDlaWyszukiwarki }
			</select>
		</div>
	</div>	
	<div>
		<div class="skinnedSelect">
			<input name="tacID5" id="tacID5" value="" title="{$__cl.wyszukaj_wg_slowa_kluczowego}"/>
		</div>
	</div>	
	<a class="button_szukaj_ofert" id="button_szukaj_ofert" href="#" title="{$__cl.wyszukaj_produkty_katalogu}" align="middle" >{$__cl.wyszukaj_produkty_katalogu}</a> 
	
	</form>
	</div>

</div>


{literal}
<script>
$(document).ready(function(){

	$(".left_details_button").click(function () {
		//wybrano kategorię
		$("#nazwa-wyszukiwarki").html($(this).attr("title"));
					
    	$.get("{/literal}{$smarty.const.HTTP_URL}{$settings_katalog_ta.mainpage|default:$page}{literal},KatalogTA,wyswietlSubKategorieDlaKategoriiDwaPoziomy,"+$(this).attr("id")+".html", function(data){
    		  $("#tacID1").html('<option value="" selected="selected">County</option>'+data);
    		  $("#tacID2").html('<option value="" selected="selected">Town</option>');
    		  $("#tacID3").html('<option value="" selected="selected">Locality</option>'); 		  
    		   	
    	});
  		  switch ($(this).attr("id")){
	    		  case '1':
		    		   $("#header_left_panel").css('backgroundImage','url({/literal}{$smarty.const.HTTP_URL|cssfiles:$smarty.server.HTTP_HOST:$settings.szablon:$settings.ramka_theme:$settings.ramka_theme_kolor:"main_left_czerwony.gif"}{literal})');
		    		   $("#nazwa-wyszukiwarki").css('color','#FFFFFF');
	    		   	break;
	    		  case '2':
		    		   $("#header_left_panel").css('backgroundImage','url({/literal}{$smarty.const.HTTP_URL|cssfiles:$smarty.server.HTTP_HOST:$settings.szablon:$settings.ramka_theme:$settings.ramka_theme_kolor:"main_left_niebieski.gif"}{literal})');
		    		   $("#nazwa-wyszukiwarki").css('color','#FFFFFF');
	    		   	break;
	    		  case '75':
		    		   $("#header_left_panel").css('backgroundImage','url({/literal}{$smarty.const.HTTP_URL|cssfiles:$smarty.server.HTTP_HOST:$settings.szablon:$settings.ramka_theme:$settings.ramka_theme_kolor:"main_left_zolty.gif"}{literal})');
	    		   	break;
  		  }	
	});
	
	$("#tacID1").change(function () {		
	    $("#tacID1 option:selected").each(function () {
	    	$.get("{/literal}{$smarty.const.HTTP_URL}{$settings_katalog_ta.mainpage|default:$page}{literal},KatalogTA,wyswietlSubKategorieDlaKategoriiDwaPoziomy,"+$(this).attr("value")+".html", function(data){
	    		  $("#tacID2").html('<option value="" selected="selected">Town</option>'+data);
	    		  $("#tacID3").html('<option value="" selected="selected">Locality</option>');
	    	});        
	    });
	});

	$("#tacID2").change(function () {		
	    $("#tacID2 option:selected").each(function () {
	    	$.get("{/literal}{$smarty.const.HTTP_URL}{$settings_katalog_ta.mainpage|default:$page}{literal},KatalogTA,wyswietlSubKategorieDlaKategoriiDwaPoziomy,"+$(this).attr("value")+".html", function(data){
	    		  $("#tacID3").html('<option value="" selected="selected">Locality</option>'+data);
	    	});
        });
	});

	$("#tacID3").change(function () {		
	    $("#tacID3 option:selected").each(function () {
        });
	});

	$("#button_szukaj_ofert").click(function() {
		if($.trim($("#tacID3").attr("value")).length > 0  ){
			document.location='{/literal}{$smarty.const.HTTP_URL}{$settings_katalog_ta.mainpage|default:$page}{literal},,show_category,'+$("#tacID3").attr("value")+'.html?s1='+$.trim($("#tacID4").attr("value"))+'&s2='+$("#tacID5").attr("value");
		}else if ( $.trim($("#tacID2").attr("value")).length > 0  ) { 
			document.location='{/literal}{$smarty.const.HTTP_URL}{$settings_katalog_ta.mainpage|default:$page}{literal},,show_category,'+$("#tacID2").attr("value")+'.html?s1='+$.trim($("#tacID4").attr("value"))+'&s2='+$("#tacID5").attr("value");
		}else if ($.trim($("#tacID1").attr("value")).length > 0 ){
			document.location='{/literal}{$smarty.const.HTTP_URL}{$settings_katalog_ta.mainpage|default:$page}{literal},,show_category,'+$("#tacID1").attr("value")+'.html?s1='+$.trim($("#tacID4").attr("value"))+'&s2='+$("#tacID5").attr("value");
		}else{
			alert("Please - select options to search.");
		}
	});
});

</script>
{/literal}



